<%@ include file="/common/taglibs.jsp"%>
   
<head>
    <title><fmt:message key="laundryRequestReceptionList.title"/></title>
    <meta name="heading" content="<fmt:message key='laundryRequestReceptionList.heading'/>"/>
    <meta name="menu" content="RoleAdminLaundry"/>

    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-es.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>

    <script type="text/javascript">
        window.onload = function() {
            Calendar.setup({
                inputField: "receivedDateID",
                ifFormat: "%d/%m/%Y",
                button: "receivedDateID"
            });
        }
    </script>
    
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helplaundryRequestItemList.html?decorate=false'/>"
           title="Help laundry request item list"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
               <fmt:message key="help"/>
        </a>
    </h2>
</div>

<table class="tableGrey" id="SelectedDatas">
    <thead>
        <tr>
            <th class="hidden"/>
            <th><fmt:message key="laundry"/></th>
            <th><fmt:message key="coin"/></th>
            <th><fmt:message key="laundryRequest.date"/></th>

            <th class="hidden"/>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td> <s:property value="laundryRequest.laundry.name" /> </td>
            <td> <s:property value="laundryRequest.coin.name" /> </td>
            <td> <s:property value="laundryRequest.date" /> </td>            

        </tr>
    </tbody>
</table>

<s:form id="laundryRequestReceptionForm" action="sendToLaundryStorage" method="post" validate="true">
    <c:if test="${not empty laundryReceptionTable.head}">
        <s:textfield key="receivedDate" id="receivedDateID" cssClass="text medium"/>
        <table class="table">
            <caption><center><fmt:message key="laundryRequestItem.numerationDetail"/></center></caption>
            <thead>
                <tr>
                    <s:iterator value="laundryReceptionTable.head">
                        <th><s:property /></th>
                    </s:iterator>
                </tr>
            </thead>
            <tbody>
                <s:iterator value="laundryReceptionTable.body" status="status">
                    <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>" style="cursor: pointer;">
                        <s:iterator value="row" status="it">
                            <td>

                                <s:if test="%{#it.index==0}">
                                    <s:if test="%{laundryReceptionTable.body.size()>#status.index+1}">
                                        <s:a href="editLaundryRequestReception.html?id=%{row.get(#it.index)}" >Edit</s:a>
                                    </s:if>
                                </s:if>
                                <s:else>
                                    <s:property />
                                </s:else>
                            </td>
                        </s:iterator>
                    </tr>
                </s:iterator>
            </tbody>
        </table>
    </c:if>

    <li class="buttonBar bottom">
        <s:submit method="send" key="button.sendToLaundryStorage" theme="simple" onclick="return confirmDelete('laundryRequest')"/>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>
</s:form>

<script type="text/javascript">
    //highlightTableRows("purchaseDetailForm");
</script>